package eteam.aps.gateway.config;

import eteam.aps.gateway.common.GatewayPropertyFactory;
import eteam.aps.gateway.model.ModuleDto;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 模块对象属性
 */
@Data
@Component
@PropertySource(value = {"classpath:modules.yml"}, encoding = "utf-8", factory = GatewayPropertyFactory.class)
@ConfigurationProperties(prefix = "system")
public class ModuleProperty {

    private List<ModuleDto> modules = new ArrayList<>();
    private List<String> excludeUrls = new ArrayList<>();

    public List<ModuleDto> getModules() {
        return modules;
    }

    public List<String> getExcludeUrls() {
        return excludeUrls;
    }
}
